﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.Platform.Migrations
{
    /// <inheritdoc />
    public partial class add_column_psninfo_posifo : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "PosInfoId",
                table: "PSN_INFO",
                type: "uuid",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.CreateIndex(
                name: "IX_PSN_INFO_PosInfoId",
                table: "PSN_INFO",
                column: "PosInfoId");

            migrationBuilder.AddForeignKey(
                name: "FK_PSN_INFO_PosInfos_PosInfoId",
                table: "PSN_INFO",
                column: "PosInfoId",
                principalTable: "PosInfos",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_PSN_INFO_PosInfos_PosInfoId",
                table: "PSN_INFO");

            migrationBuilder.DropIndex(
                name: "IX_PSN_INFO_PosInfoId",
                table: "PSN_INFO");

            migrationBuilder.DropColumn(
                name: "PosInfoId",
                table: "PSN_INFO");
        }
    }
}
